<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>API Example using PHP</title>
        
        <!-- GOOGLE FONTS -->
        <link href='http://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700' rel='stylesheet' type='text/css'>
        <link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,300,600' rel='stylesheet' type='text/css'>
        <!-- /GOOGLE FONTS -->

        <link rel="stylesheet" href="../../assets/css/bootstrap.css">
        <link rel="stylesheet" href="../../assets/css/font-awesome.css">
        <link rel="stylesheet" href="../../assets/css/icomoon.css">
        <link rel="stylesheet" href="../../assets/css/styles.css">
        <script src="../../assets/js/modernizr.js"></script>
        
    </head>
    <body>
        
        <div class="global-wrap">
            <div class="container">
                <div class="gap"></div>
                <div id="tables" class="row">
                    <?php
                        $url='http://mschotels.com/api/msc-api.php?action=getHotels';
                        $ch=curl_init($url);
                        curl_setopt($ch, CURLOPT_TIMEOUT, 5);
                        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                        $data=curl_exec($ch);
                        curl_close($ch);
                        $data = json_decode($data, true);
                        foreach($data as $hotel):
                    ?>
                        <table class="table table-striped">
                            <tr><td>Name</td><td><?php echo $hotel['hotelName'] ?></td></tr>
                            <tr><td>Stars</td><td><?php echo $hotel['hotelStars'] ?></td></tr>
                            <tr><td>Phone</td><td><?php echo $hotel['hotelPhone'] ?></td></tr>
                            <tr><td>Email</td><td><?php echo $hotel['hotelEmail'] ?></td></tr>
                            <tr><td>Website</td><td><?php echo $hotel['hotelWebsite'] ?></td></tr>
                            <tr><td>Address</td><td><?php echo $hotel['hotelAddress'] ?></td></tr>
                            <tr><td>Postal Code</td><td><?php echo $hotel['hotelZIP'] ?></td></tr>
                            <tr><td>City</td><td><?php echo $hotel['hotelCity'] ?></td></tr>
                            <tr><td>Country</td><td><?php echo $hotel['hotelCountry'] ?></td></tr>
                            <tr><td>Coordinates</td><td><?php echo $hotel['hotelCoords'] ?></td></tr>
                            <tr><td>Details</td><td><?php echo $hotel['hotelDetails'] ?></td></tr>
                            <tr><td>Facilities</td><td><?php print_r($hotel['hotelFacilities']) ?></td></tr>
                            <tr><td>Photos</td><td><?php print_r($hotel['hotelPhotos']) ?></td></tr>
                            <tr><td>Featured</td><td><?php echo $hotel['isFeatured'] ?></td></tr>
                        </table><div class="gap"></div>
                    <?php endforeach; ?>
                </div>
            </div>
        </div>

        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
        <script src="../../assets/js/bootstrap.js"></script>
        <script src="../../assets/js/slimmenu.js"></script>
        <script src="../../assets/js/bootstrap-datepicker.js"></script>
        <script src="../../assets/js/bootstrap-timepicker.js"></script>
        <script src="../../assets/js/nicescroll.js"></script>
        <script src="../../assets/js/dropit.js"></script>
        <script src="../../assets/js/ionrangeslider.js"></script>
        <script src="../../assets/js/icheck.js"></script>
        <script src="../../assets/js/fotorama.js"></script>
        <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
        <script src="../../assets/js/typeahead.js"></script>
        <script src="../../assets/js/card-payment.js"></script>
        <script src="../../assets/js/magnific.js"></script>
        <script src="../../assets/js/owl-carousel.js"></script>
        <script src="../../assets/js/fitvids.js"></script>
        <script src="../../assets/js/tweet.js"></script>
        <script src="../../assets/js/countdown.js"></script>
        <script src="../../assets/js/gridrotator.js"></script>
        <script src="../../assets/js/custom.js"></script>
    </body>
</html>